from fastapi import APIRouter, UploadFile, File, Form
from .service import parse_pptx, restore_pptx

router = APIRouter()

@router.post("/parse_pptx/")
async def api_parse_pptx(file: UploadFile = File(...)):
    folder_path = await parse_pptx(file)
    return {"folder_path": folder_path}

@router.post("/restore_pptx/")
async def api_restore_pptx(folder_path: str = Form(...)):
    restored_folder = restore_pptx(folder_path)
    return {"restored_folder": restored_folder} 